import http from "@/utils/http";

// 获取知识图谱列表
export async function getGraph(body) {
	return http.get("/graph/list", body);
}

// 新增知识图谱
export async function addGraph(body) {
	return http.postFormData("/graph/add", body);
}

// 删除知识图谱
export async function delGraph(body) {
	return http.postFormData("/graph/delete", body);
}

// 停用/启用知识图谱
export async function fixGraphStatus(body) {
	return http.postFormData("/graph/disabled", body);
}

// 根据词槽id查询词槽详情
export async function fetchSlotDetailBySlotId(params) {
	return http.post("/knowledge/base/getSlotValues", params);
}

// 查询图谱详情
export async function mappingKnowledgeDomainDetail(params) {
	return http.get("/graph/info", params);
}

// 新增图谱节点
export async function saveAndEditerCategoryNode(params) {
	return http.post("/graph/node/add", params);
}

// 删除节点
export async function removeCategory(params) {
	return http.postFormData("/graph/node/delete", params);
}

// 修改节点name
export async function editerCategoryNode(params) {
	return http.post("/graph/editerCategoryNode", params);
}

// 保存知识点
export async function saveQA(params) {
	return http.post("/graph/saveQa", params);
}

// 获取qaId
export async function getQaId(body) {
	return http.get("/knowledge/base/qaId", body);
}

// 获取知识详情
export async function getKnowledgeDetail(params) {
	return http.post("/knowledge/base/getKnowledgeDetail", params);
}
// 获取相似问详情
export async function getAlikeQuestionList(params) {
	return http.post("/knowledge/base/getAlikeQuestionList", params);
}
// 获取标准问
export async function getStandardQuestion(params) {
	return http.post("/knowledge/base/getStandardQuestion", params);
}
// 获取答案
export async function getAnswer(params) {
	return http.post("/knowledge/base/qa/answer", params);
}

// 获取关联问题
export async function fakeAnswerRelevanceData(params) {
	return http.post("/knowledge/relation/question", params);
}

// 获取流程引导
export async function processGuide(body) {
	return http.get("/processGuide/processDetail", body);
}

// 编辑流程引导
export async function editProcessGuide(body) {
	return http.post("/processGuide/editProcessGuide", body);
}

export async function downloadGraph(body) {
	return http.downloadFile("/graph/exportQa", body);
}

export async function atlasNodesPage(body) {
	return http.post("/graph/atlasNodesPage", body);
}

// 剪切node

export async function cutNodes(body) {
	return http.post("/v2/atlas/cutNodes", body);
}

// 复制node

export async function copyNodes(body) {
	return http.post("/v2/atlas/copyNodes", body);
}

// version

export async function getUpdateDetail(body) {
	return http.post("/v2/version/getUpdateDetail", body);
}

export async function push(body) {
	return http.post("/v2/version/push", body);
}

export async function updatePushStatus(body) {
	return http.post("/v2/atlas/updatePushStatus", body);
}

export async function getOldVersionDetail(body) {
	return http.post("/v2/version/getOldVersionDetail", body);
}
export async function getNewVersionDetail(body) {
	return http.post("/v2/version/getNewVersionDetail", body);
}
export async function getVersionDetail(body) {
	return http.post("/v2/version/getVersionDetail", body);
}

export async function getCityUpdateDetail(body) {
	return http.post("/v2/version/getCityUpdateDetail", body);
}

export async function getShareAtlas(body) {
	return http.get("/v2/share/atlas/tree", body);
}

export async function getNodeDetail(body) {
	return http.post("/v2/share/atlas/node/getNodeDetail", body);
}

export async function editShareNode(body) {
	return http.post("/v2/share/atlas/node/edit", body);
}

export async function getCityTBCAnswer(body) {
	return http.get("/v2/share/atlas/getCityTBCAnswer", body);
}

export async function updateQaEdit(body) {
	return http.post("/qaEdit/base/updateQaEdit", body);
}

export async function confirmAnswer(body) {
	return http.post("/v2/share/atlas/node/confirm", body);
}

export async function switchShareAtlas(body) {
	return http.post("/v2/share/atlas/switchShareAtlas", body);
}

export async function getShareNodeList(body) {
	return http.post("/v2/share/atlas/getNodeList", body);
}

export async function confirmAnswerAddEdit(body) {
	return http.post("/v2/share/atlas/node/addEdit", body);
}

export async function delEdit(body) {
	return http.post("/v2/share/atlas/node/delEdit", body);
}

export async function getMore(body) {
	return http.post("/v2/version/getMore", body);
}

/**
 * 2.0版本接口
 */

/**
 * 获取节点详情
 */
export async function fetchNodeDetailByNodeId(body) {
	return http.get("/graph/node/info", body);
}

/**
 * 编辑节点
 */
export async function doEditNodeInfo(body) {
	return http.post("/graph/node/edit", body);
}

/**
 * 获取图谱分类
 */
export async function fetchGraphCategory(body) {
	return http.get("/graph/category/info", body);
}

/**
 * 保存图谱分类
 */
export async function doEditCategory(body) {
	return http.post("/graph/category/edit", body);
}

/**
 * 移动图谱分类
 */

export async function doMoveCategory(body) {
	return http.postFormData("/graph/move", body);
}

/**
 * 图谱基本信息
 */
export async function fetchGraphInfo(body) {
	return http.get("/graph/simple/info", body);
}

/**
 * 图谱节点移动
 */
export async function doMoveNode(body) {
	return http.postFormData("/graph/node/move", body);
}

/**
 * 导图导出
 */
 export async function doExportGraph(body) {
	return http.downloadFile("/graph/exportAtlasInfo", body);
}

/**
 * 导图导入
 */
 export async function doImportGraph(body) {
	return http.uploadFile("/graph/importAtlasInfo", body);
}


// 模板市场-->系统知识库-->导图列表
export async function knowledgeListAtlas(body) {
	return http.get("/knowledge/systemTemplate/listAtlas", body);
}
// 模板市场-->系统知识库-->导图基础信息
export async function knowledgeAtlasInfo(body) {
	return http.get("/knowledge/systemTemplate/getAtlasInfo", body);
}
// 模板市场-->系统知识库-->导图节点树
export async function knowledgeAtlasTree(body) {
	return http.get("/knowledge/systemTemplate/getAtlasTree", body);
}
// 模板市场-->系统知识库-->导图分类信息
export async function knowledgeAtlasCategoryInfo(body) {
	return http.get("/knowledge/systemTemplate/getAtlasCategoryInfo", body);
}
// 模板市场-->系统知识库-->导图节点信息
export async function knowledgeAtlasNodeDetail(body) {
	return http.get("/knowledge/systemTemplate/getNodeDetail", body);
}

